#include <bits/stdc++.h>
using namespace std;
using uint=unsigned int;
using ll=long long;
using ull=unsigned long long;
using i128=__int128;
const int N=1e6+5;

void solve(){
    
    return;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n;
    cin>>n;
    map<int,int> a;
    for(int i=0;i<n;i++){
        int num;
        cin>>num;
        if(!a.count(num)){
            a[num]=i+1;
            if(i)cout<<" "<<"-1";
            else cout<<"-1";
        }else{
            cout<<" "<<a[num];
            a[num]=i+1;
        }
    }

    return 0;
}